return

return statusCode
Note

Note

This is a script command and operates only in scripts or on the command line when scripting is enabled with the following command: enable cli scripting {permanent} .

Description

Exits the current script and sets the $STATUS variable.

Syntax Description

statusCode Specifies a integer value to which the $STATUS variable is set.

Default

N/A.

Usage Guidelines

When used in nested scripts, this command allows you to terminate the current script, set the $STATUS variable, return to the parent script, and evaluate the $STATUS variable in the parent script. For more information on the $STATUS variable, see “Using CLI Scripting” in the Switch Engine v33.1.1 User Guide .

Example

The following example exits the current script and sets the $STATUS variable to -200:
return -200

History

This command was first available in ExtremeXOS 12.4.

Platform Availability

This command is available on all Universal switches supported in this document.